package IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("./test.png.jpeg");
        FileOutputStream fos=new FileOutputStream("./copy3.png.jpeg");
        int i;
        long begin=System.currentTimeMillis();
        byte[] bytes = new byte[1024*10];
        while((i= fis.read(bytes))!=-1)
        {
            fos.write(bytes,0,i);
            //fos.write(bytes);
        }
        long end=System.currentTimeMillis();
        System.out.println((double)end-(double)begin);
        fis.close();
        fos.close();
    }
}
